<template>
  <view class="ver-layout">
    <video class="myVideo" :src="videoInfo.record_url" @error="videoErrorCallback" controls></video>
    <view class="video-title">{{ videoInfo.title }}</view>
    <view class="video-content">
      <view class="content-title">简介：</view>
      <view class="content-text">
        {{ videoInfo.description }}
      </view>
    </view>
  </view>
</template>

<script>
import {RecordCourseApi} from "@/api/teacherManage.js"

let engine = new RecordCourseApi()

export default {
  name: "recordVideo",
  data() {
    return {
      videoObj: {},
      videoInfo: {}
    }
  },
  onLoad(options) {
    uni.setNavigationBarTitle({title: options.title})
    this.videoObj = options
    this.getRecordCourseDetail()
  },
  methods: {
    getRecordCourseDetail() {
      engine.getRecordCourseDetail(this.videoObj.id).then(res => {
        this.videoInfo = res.data
      })
    },
    videoErrorCallback(e) {
      console.error(e)
    },
  }
}
</script>

<style scoped>
.myVideo {
  width: 100%;
  height: 188px;
  background: #75544A;
}

.video-title {
  width: 100%;
  height: 50px;
  padding-left: 11px;
  border-bottom: 1px solid #E9E9E9;
  /* 文本样式 */
  font-size: 15px;
  line-height: 50px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  color: #323137;
}

.video-content {
  padding: 12px;
}

.content-title {
  font-size: 14px;
  line-height: 14px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  color: #323137;
}

.content-text {
  margin: 0px 3px;
  margin-top: 12px;
  font-size: 12px;
  font-family: Source Han Sans CN;
  color: #333333;
  line-height: 18px;
}
</style>
